"""
    @Author  ：思念 
    @File    ：3.进程之间不共享资源.py
    @Date    ：2025/3/7 11:18 
"""

import time
from multiprocessing import Process

nums = [1, 2]


def work_1():
    for i in range(3, 6):
        nums.append(i)
        time.sleep(1)
    print("work_1:", nums)


def work_2():
    for i in range(6, 10):
        nums.append(i)
        time.sleep(1)
    print("work_2:", nums)


if __name__ == '__main__':
    p1 = Process(target=work_1)
    p2 = Process(target=work_2)
    p1.start()
    p1.join()
    p2.start()
    p2.join()
    nums = ['a', 'b']
    print("主进程:", nums)
    print("主程序结束。。。。。。")
